package com.happycat.social.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.happycat.base.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.util.Date;


/**
 * 交易流水对象 social_trans
 * 
 * @author jsonbin
 * @date 2020-08-29
 */
@Data
@ToString
@EqualsAndHashCode
@NoArgsConstructor
@Accessors(chain = true)
@TableName("social_trans")
public class SocialTrans extends BaseEntity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 待支付
     */
    public static final int STATUS_UNPAID = 0;
    /**
     * 支付中
     */
    public static final int STATUS_PAYING = 1;
    /**
     * 支付成功
     */
    public static final int STATUS_PAID = 2;
    /**
     * 支付失败
     */
    public static final int STATUS_FAIL = 4;

    /**
     * 流水编号
     */
    @ApiModelProperty(value = "流水编号")
    @TableField(value = "trans_no")
    private String transNo;

    /**
     * 流水类型: 1充值流水，2礼物流水，3开宝箱流水，4赠送流水
     */
    @ApiModelProperty(value = "流水类型: 1充值流水，2礼物流水，3开宝箱流水，4赠送流水")
    @TableField(value = "trans_type")
    private String transType;

    /**
     * 房间id(有的是在房间里给主播赠送的，此时需要记录房间id)
     */
    @ApiModelProperty(value = "房间id(有的是在房间里给主播赠送的，此时需要记录房间id)")
    @TableField(value = "room_id")
    private String roomId;

    /**
     * 房间名
     */
    @ApiModelProperty(value = "房间名")
    @TableField(value = "room_name")
    private String roomName;

    /**
     * 支付用户id
     */
    @ApiModelProperty(value = "支付用户id")
    @TableField(value = "pay_user_id")
    private Long payUserId;

    /**
     * 支付账户id, 用于支持多账户体系
     */
    @ApiModelProperty(value = "支付账户id, 用于支持多账户体系")
    @TableField(value = "pay_account_id")
    private Long payAccountId;

    /**
     * 收款用户id
     */
    @ApiModelProperty(value = "收款用户id")
    @TableField(value = "receive_user_id")
    private Long receiveUserId;

    /**
     * 收款账户id, 用于支持多账户体系
     */
    @ApiModelProperty(value = "收款账户id, 用于支持多账户体系")
    @TableField(value = "receive_account_id")
    private Long receiveAccountId;

    /**
     * 支付金额/币数量
     */
    @ApiModelProperty(value = "支付金额/币数量")
    @TableField(value = "pay_amount")
    private BigDecimal payAmount;

    /**
     * 支付币类型: 1人名币，0猫粮
     */
    @ApiModelProperty(value = "支付币类型: 1人名币，0猫粮")
    @TableField(value = "pay_amount_type")
    private String payAmountType;

    /**
     * 获得的金额/币数量
     */
    @ApiModelProperty(value = "获得的金额/币数量")
    @TableField(value = "receive_amount")
    private BigDecimal receiveAmount;

    /**
     * 获得币类型: 1人名币，0猫粮
     */
    @ApiModelProperty(value = "获得币类型: 1人名币，0猫粮")
    @TableField(value = "receive_amount_type")
    private String receiveAmountType;

    /**
     * 支付状态:0:待支付，1支付中，2已支付，4支付失败
     */
    @ApiModelProperty(value = "支付状态:0:待支付，1支付中，2已支付，4支付失败")
    @TableField(value = "status")
    private Integer status;

    /**
     * 支付时间/到账时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "支付时间/到账时间")
    @TableField(value = "pay_time")
    private Date payTime;

    /**
     * 支付渠道: 0系统, 1支付宝, 2微信
     */
    @ApiModelProperty(value = "支付渠道: 0系统, 1支付宝, 2微信")
    @TableField(value = "pay_channel")
    private Integer payChannel;

    @ApiModelProperty(value = "支付渠道: 0.APP, 1.小程序, 2.公众号")
    @TableField(value = "pay_source")
    private Integer paySource;

    /**
     * 支付渠道: 0系统, 1支付宝, 2微信
     */
    @ApiModelProperty(value = "支付渠道: 0系统, 1支付宝, 2微信")
    @TableField("third_trans_no")
    private String thirdTransNo;

    /**
     * 额外字段1
     */
    @ApiModelProperty(value = "额外字段1")
    @TableField(value = "extra1")
    private String extra1;

    /**
     * 额外字段2
     */
    @ApiModelProperty(value = "额外字段2")
    @TableField(value = "extra2")
    private String extra2;

    /**
     * 额外字段3
     */
    @ApiModelProperty(value = "额外字段3")
    @TableField(value = "extra3")
    private String extra3;
}
